'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;

  // 普通路由
  // 缺省页,测试微信页面
  router.get('/', controller.home.homeController.index);

  // 测试
  router.get('/test', controller.test.testController.test1);

  // 记录相关的路由
  router.get('/records/:id', controller.record.recordController.findRecordOne);
  router.get('/records', controller.record.recordController.findRecordList);
  router.post('/records', controller.record.recordController.addRecord);
  router.patch('/records/:id', controller.record.recordController.updateRecordOne);
  router.delete('/records/:id', controller.record.recordController.deleteRecordOne);
};
